fname='/home/chu/scene_flow/scene_flow_2015/training/calib/calib_cam_to_cam/000000.txt'
fid = fopen(fname,'r');
% read the first 25 lines and do nothing to them
for k=1:25;
    tline = fgets(fid);
end
% next reading will be on 37th line.
% get the 26th line as the P matrix of left cam
text=textscan(fid,['%s',repmat('%f',[1,12])],1);
res=cell2mat(text(2:13));

% get the 34th line as the P matrix of right cam
for k=1:8;
    tline = fgets(fid);
end
text=textscan(fid,['%s',repmat('%f',[1,12])],1);
res=[res cell2mat(text(2:13))];

fclose(fid)

% fid=fopen('my_file.txt','w');
% for i=1:40
%     fprintf(fid,'%04d\n',i);
% end
% fclose(fid);